package com.bos.quartz;
import com.bos.service.PromotionService;
import com.bos.service.WayBillSearchService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
/**
 * @author misterWei
 * @create 2018年11月20号:14点35分
 * @mailbox mynameisweiyan@gmail.com
 */
public class PromotionStatusQuartz implements Job {
 //采用任务调度的方式对数据库中的Promotion表的结束时间做出状态更改
   @Autowired
   private PromotionService promotionService;
   @Autowired
   private WayBillSearchService wayBillSearchService;
    @Override
    public void execute(JobExecutionContext jobExecutionContext){
       // System.out.println("更新Promotion状态定时启动!");
        promotionService.updateStatus(new Date());
        wayBillSearchService.syncWayBill();
    }
    /**
     * 定时完成工单与索引的数据同步
     */

}
